﻿@using WebSite.Views
@using WebSite.ViewModels
@using WebSite.ViewModels.Fields
@using ControleRepresentante.Logic.Models

@model User

<h2>Alterar Meus Dados</h2>

@using (Html.BeginForm("Edit", "MyInfo", FormMethod.Post, new { id = "editForm", name = "editForm" }))
{
    Html.ValidationSummary(true);
    
    @(Html.FormLayoutViewModel()
        .AddField(new LabelField("Usuário", "username", Model.Username))
        .AddField(new TextBoxField("E-mail", "email", Model.Email, true))
        .AddField(new PasswordField("Senha", "password", Model.Password, true))
        .Render(1))

    @(Html.Buttons()
        .Add(ButtonType.Insert, "#", "Salvar", "javascript:editForm.submit()")
        .Add(Model, "MyInfo", ButtonType.Cancel))
}
